package io.renren.modules.generator.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.generator.dao.EnterpriseThirdBindRecordDao;
import io.renren.modules.generator.entity.EnterpriseThirdBindRecordEntity;
import io.renren.modules.generator.service.EnterpriseThirdBindRecordService;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("enterpriseThirdBindRecordService")
public class EnterpriseThirdBindRecordServiceImpl extends ServiceImpl<EnterpriseThirdBindRecordDao, EnterpriseThirdBindRecordEntity> implements EnterpriseThirdBindRecordService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<EnterpriseThirdBindRecordEntity> page = this.page(
                new Query<EnterpriseThirdBindRecordEntity>().getPage(params),
                new QueryWrapper<>()
        );
        return new PageUtils(page);
    }

    @Override
    public boolean updateByUserNo(EnterpriseThirdBindRecordEntity enterpriseThirdBindRecordEntity) {
        return getBaseMapper().updateByUserNo(enterpriseThirdBindRecordEntity) > 0;
    }

}